﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FruitManagerApp
{
    public class TreeViewData
    {
        private static TreeViewData _Data = null;

        public static TreeViewData Data
        {
            get
            {
                if (_Data == null)
                {
                    _Data = new TreeViewData();
                }

                return _Data;
            }
        }

        private System.Collections.ObjectModel.ObservableCollection<TreeNode> _RootNodes = null;

        public IList<TreeNode> RootNodes { get { return _RootNodes ?? (_RootNodes = new System.Collections.ObjectModel.ObservableCollection<TreeNode>()); } }
        public class TreeNode
        {
            public string Label { get; set; }

            public string UID { get; set; }

            public int Level { get; set; }

            private System.Collections.ObjectModel.ObservableCollection<TreeNode> _ChildNodes = null;

            public IList<TreeNode> ChildNodes { get { return _ChildNodes ?? (_ChildNodes = new System.Collections.ObjectModel.ObservableCollection<TreeNode>()); } }
        }
    }
}
